﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace GMAC.ReportingSystem.Business.Entities
{
    /// <summary>
    /// Represents a menu item.
    /// </summary>
    [Serializable]
    public class Menu
    {
        /// <summary>
        /// Gets or sets the menu id.
        /// </summary>
        /// <value>The menu id.</value>
        [XmlAttribute(AttributeName = "id")]
        public int MenuId { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [XmlAttribute(AttributeName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>The description.</value>
        [XmlAttribute(AttributeName = "description")]
        public string Description { get; set; }

        /// <summary>
        /// Gets or sets the destination URL.
        /// </summary>
        /// <value>The URL.</value>
        [XmlAttribute(AttributeName = "url")]
        public string URL { get; set; }

        /// <summary>
        /// Gets or sets the URL of the image that will appear in the menu item.
        /// </summary>
        /// <value>The image URL.</value>
        [XmlAttribute(AttributeName = "imageUrl")]
        public string ImageURL { get; set; }

        /// <summary>
        /// Gets or sets the action.
        /// </summary>
        /// <value>The action.</value>
        [XmlAttribute(AttributeName = "action")]
        public string Action { get; set; }

        /// <summary>
        /// Gets or sets the sub menus.
        /// </summary>
        /// <value>The sub menus.</value>
        [XmlArray(ElementName = "SubMenus")]
        public MenuCollection SubMenus { get; set; }
    }

    /// <summary>
    /// A collection of menu items.
    /// </summary>
    [Serializable]
    public class MenuCollection : List<Menu>
    { }
}
